package common.utils
{
	public class MathUntil
	{
		public static function physicsCollision(v0:Number,m0:Number,v1:Number,m1:Number) : Array
		{
			var v0Final : Number = ((m0 - m1)*v0 + 2*m1*v1)/(m0+m1);
			
			var v1Final : Number = ((m1 - m0)*v1 + 2*m0*v0)/(m0+m1);
			
			return [v0Final,v1Final];
		}
		
		public static function random(min:int = 0, max:int = 100) : int
		{
			return (max - min) * Math.random() + min;
		}
		
		public static function randomNumber(min:Number = 0, max:Number = 100) : Number
		{
			return (max - min) * Math.random() + min;
		}
	}
}